/*
 * ---------------------------------------------------------------------
 * Copyright (c) 2014, 2015 All Right Reserved
 * This software is developed for study and improve coding skill ...
 *
 * Project:  Excellent Coding< EC >
 *
 * ecMutex.h
 * This file for Mutex define.
 *
 * Eamil:   epengao@126.com
 * Author:  Peter Gao
 * Version: Intial first version.
 * --------------------------------------------------------------------
 */

#ifndef EC_MUTEX_H
#define EC_MUTEX_H

#include "ecBaseType.h"

#ifdef _WIN32
#include <windows.h>
#else
#include <pthread.h>
#endif

namespace ec {

class ecMutex
{
public:
    ecMutex();
    ~ecMutex();
    void Lock();
    void UnLock();

private:
#ifdef _WIN32
    HANDLE              m_hMutex;
#else
    pthread_mutex_t     m_hMutex;
#endif
};

} /* namespace ec */
#endif /* EC_MUTEX_H */